package cn.addr.server.message;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.util.UUID;

import org.junit.Test;

import cn.addr.user.model.UserBean;

public class ObjectReadUtil {
	
	public static UserBean read(InputStream inputStream){
		ObjectInputStream ois = null;
		UserBean result = null;
		try {
			ois = new ObjectInputStream(inputStream);
			
			result = (UserBean) ois.readObject();
			ois.close();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return result;
	}
	
	@Test
	public void testuuid(){
		for(int i = 0 ; i < 40 ; i ++){
			String uuid = UUID.randomUUID().toString();
			System.out.println(uuid);
		}
	}
}
